<template>
    <div class="header_item">
        <svg class="iconpark-icon" @click="UpdateCollapse">
            <use :href="collapse?'#menu-unfold-one':'#menu-fold-one'"></use>
        </svg>
    </div>
</template>

<script>
import {mapGetters} from "vuex";

export default {
    computed: mapGetters(["collapse","model"]),
    methods: {
        UpdateCollapse() {
            if (this.model === 'classic') {
                this.$store.dispatch("UpdateCollapse", !this.collapse);
                return;
            }
            if (this.$route.name !== '首页') {
                this.$store.dispatch("UpdateCollapse", !this.collapse);
            } else {
                this.$store.dispatch("UpdateCollapse", false);
            }
        }
    }
};
</script>
